package team.knowers.qzhserver.common.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import team.knowers.qzhserver.user.user.service.UserService;


/**
 * @author xtg
 * @date 2024/2/12 16:51
 */
@Configuration
public class UserDetailsServiceConfig {
    @Autowired
    private UserService userService;
    @Bean
    public org.springframework.security.core.userdetails.UserDetailsService userDetailsService() {
        return username -> userService.loadUserByUsername(username);
    }
}
